<template>
  <el-button v-bind="column.style" @click="onClickButton">
    {{ column.label }}
  </el-button>
</template>

<script setup lang="ts">
import { tableColumn } from '@/components/table/column'

const props = defineProps<{
  data: Record<string, any>
  column: tableColumn
  prop: string
}>()

const onClickButton = () => {
  if (
    props.column.callback &&
    Object.prototype.toString.call(props.column.callback) ===
      '[object Function]'
  ) {
    props.column.callback(props.data, props.prop)
  }
}
</script>

<style scoped lang="scss"></style>
